<div class="row">
	<div class="col-md-12">
		<ol class="breadcrumb">
			<li>
				<a href="#" onclick="toHome()">
					主页
				</a>
			</li>
			<li>
				<a href="#" onclick="toMovieTicketRecord()">
					电影票记录列表
				</a>
			</li>
			<li class="active">
				电影票记录详情
			</li>
		</ol>
	</div>
</div>
<form role="form" class="form-horizontal">
	<div class="row page-cont">
		<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 cont-top">
			<div class="panel panel-white">
				<div class="panel-heading">
					<h4 class="panel-title">
						<span class="title-text">电影票记录详情</span>
					</h4>
					<div class="panel-tools">
						<div class="dropdown">
							<a data-toggle="dropdown" class="btn btn-xs dropdown-toggle btn-transparent-grey">
								<i class="fa fa-cog"></i>
							</a>
							<ul class="dropdown-menu dropdown-light pull-right" role="menu">
								<li>
									<a class="panel-collapse collapses" href="#"><i class="fa fa-angle-up"></i> <span>折叠</span> </a>
								</li>
								<li>
									<a class="panel-expand" href="#">
										<i class="fa fa-expand"></i> <span>全屏</span>
									</a>
								</li>
							</ul>
						</div>
						<a class="btn btn-xs btn-link panel-close" href="#">
							<i class="fa fa-times"></i>
						</a>
					</div>
				</div>
				<div class="row table-btn">
					<div class="col-sm-5">
			  			<button type="button" class="btn btn-primary">导出</button>
			  		</div>
				</div>
				<div class="panel-body table-body" style="height: auto">
					<table class="table table-bordered table-hover">
						<thead>
							<tr>
								<!-- <th class="hidden-xs">批次号</th> -->
								<th class="hidden-xs">城市</th>
								<th class="hidden-xs">影院</th>
								<th class="hidden-xs">电影名称</th>
								<th class="hidden-xs">放映室名称</th>
								<th class="hidden-xs">坐位名称</th>
								<th class="hidden-xs">取票码</th>
								<th class="hidden-xs">放映时间</th>
								<th class="hidden-xs">状态</th>
							</tr>
						</thead>
						<tbody>
							
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>
</form>
<script>
	/*********************************变量***********************************/
	
	var username = GetQueryString("username");    // 用户姓名
	var token = MXCookie.get("token",token);      // 登陆token   
	/*********************************事件***********************************/





	/*********************************函数***********************************/
	// 获取列表
	function getList() {
		$("tbody").html("");
		$.ajax({
			url: localStorage.grobalUrl + "/schedule/orderTicketListDetail",
			type: "post",
			data:{
				username: username,
				token: token,  
				batchNo: $(".pageAdd").attr("data-id")
			},
			success: function(data){
				console.log(data);
				var str =  '<tr align="center">'+
								'<td class="city-name"></td>'+
								'<td class="cinema-name"></td>'+
								'<td class="film-name"></td>'+
								'<td class="hall-name"></td>'+
								'<td class="seat-name"></td>'+
								'<td class="ticket-code"></td>'+
								'<td class="start-time"></td>'+
								'<td class="ticket-status"></td>'+
							'</tr>';
				if(data.errCode == "00005"){
					tips("请重新登陆");
					setTimeout(function(){
						window.location.href = "login_login.html";
					},500);
				}else if (data){
			        for(var i = 0; i < data.length; i ++){
			            var listVal = data[i];
			            $("tbody").append(str);
			            $(".city-name").eq(i).text(listVal.city_name);
			            $(".cinema-name").eq(i).text(listVal.cinema_name);
			            $(".film-name").eq(i).text(listVal.film_name);
			            $(".film-name").eq(i).text(listVal.film_name);
			            $(".hall-name").eq(i).text(listVal.hall_name);
			            $(".seat-name").eq(i).text(listVal.seat_names);
			            $(".ticket-code").eq(i).text(listVal.ticket_contents);
			            $(".start-time").eq(i).text(listVal.schedule_start_time);
			            if(listVal.status == "LOCKING"){
			            	$(".ticket-status").eq(i).text("锁座中");
			            }else if(listVal.status == "LOCK_SUCCESS"){
			            	$(".ticket-status").eq(i).text("锁座成功");
			            }else if(listVal.status == "UN_LOCK_SUCCESS"){
			            	$(".ticket-status").eq(i).text("座位解锁成功");
			            }else if(listVal.status == "UN_LOCK_FAIL"){
			            	$(".ticket-status").eq(i).text("座位解锁失败");
			            }else if(listVal.status == "PAYING"){
			            	$(".ticket-status").eq(i).text("正在支付");
			            }else if(listVal.status == "PAY_SUCCESS"){
			            	$(".ticket-status").eq(i).text("支付成功");
			            }else if(listVal.status == "PAY_CANCEL"){
			            	$(".ticket-status").eq(i).text("支付取消");
			            }else if(listVal.status == "PAY_FAIL"){
			            	$(".ticket-status").eq(i).text("支付失败");
			            }else if(listVal.status == "TICKETING_SUCCESS"){
			            	$(".ticket-status").eq(i).text("出票成功");
			            }else if(listVal.status == "TICKETING_FAIL"){
			            	$(".ticket-status").eq(i).text("出票失败");
			            }else if(listVal.status == "TICKETING_DOING"){
			            	$(".ticket-status").eq(i).text("出票中");
			            }else if(listVal.status == "TICKETING_RETRYING"){
			            	$(".ticket-status").eq(i).text("出票重试中");
			            }else{
			            }
			        }
				}else{
				  $("tbody").append("<tr><td align='center' colspan='8'>暂无数据</td></tr>");
				}
					
			},
			error: function(error){
				console.log(error);
			}
		});	
	}
	getList();

	
	


	
</script>
